import Vue from "vue"
import VueRouter from "vue-router"

Vue.use(VueRouter)

const routes = [
  {
    path: '*',
    redirect: '/film'
  },
  {
    path: '/film',
    component: () => import('../views/FilmView.vue'),
    redirect: '/film/nowPlaying',
    children: [
      {
        path: '/film/nowPlaying',
        component: () => import('../views/film/NowPlaying.vue'),
      },
      {
        path: '/film/comingSoon',
        component: () => import('../views/film/ComingSoon.vue'),
      }
    ]
  },
  {
    path: '/cinema',
    component: () => import('../views/CinemaView.vue')
  },
  {
    path: '/cinema/search',
    component: () => import('../views/CinemaSearch.vue')
  },
  {
    path: '/city',
    component: () => import('../views/City.vue')
  },
  {
    path: '/mine',
    component: () => import('../views/MineView.vue')
  },
  {
    path: '/film/:filmId',
    component: () => import('../views/FilmDetail.vue')
  }
]

export default new VueRouter({
  routes,
  mode: 'hash'
})

